package com.wbcs.system.intercept;

import java.util.Map;

import com.itextpdf.text.Document;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfStamper;
import com.wbcs.config.component.IComponentConfigBean;
import com.wbcs.system.component.application.report.abstractreport.AbsReportType;

public abstract class AbsPdfInterceptor
{
    /***************************************************************************
     *  下面是针对没有配置模板的报表显示到PDF时的拦截方法                                                  
     **************************************************************************/

    public boolean beforeDisplayReportWithoutTemplate(Document document,AbsReportType reportTypeObj)
    {
        return true;
    }

    public void afterDisplayReportWithoutTemplate(Document document,AbsReportType reportTypeObj)
    {}

    public void beforeDisplayPdfPageWithoutTemplate(Document document,AbsReportType reportTypeObj)
    {}

    public void afterDisplayPdfPageWithoutTemplate(Document document,AbsReportType reportTypeObj)
    {}

    public void displayPerColDataWithoutTemplate(AbsReportType reportTypeObj,Object configbean,int rowidx,String value,PdfPCell cell)
    {}

    /***************************************************************************
     *  下面是针对有模板的拦截方法                                                  
     **************************************************************************/

    public boolean beforeDisplayPdfPageWithTemplate(IComponentConfigBean ccbean,Map<String,AbsReportType> mReportTypeObjs,int rowindex,
            PdfStamper pdfstamp)
    {
        return true;
    }

    public String beforeDisplayFieldWithTemplate(IComponentConfigBean ccbean,Map<String,AbsReportType> mReportTypeObjs,int rowindex,
            PdfStamper pdfstamp,String fieldname,String fieldvalue)
    {
        return fieldvalue;
    }

    public void afterDisplayPdfPageWithTemplate(IComponentConfigBean ccbean,Map<String,AbsReportType> mReportTypeObjs,int rowindex,PdfStamper pdfstamp)
    {}
}
